//
//  PropertyCell.m
//  YunGui
//
//  Created by HanenDev on 16/3/22.
//  Copyright © 2016年 hanen. All rights reserved.
//

#import "PropertyCell.h"

#define CELLH 90.0f

@implementation PropertyCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        CGFloat lineX = [UIView getWidth:25];
        CGFloat cellY = 5+5;
        CGFloat startX= lineX + [UIView getWidth:15];
        CGFloat rightSpace = [UIView getWidth:15];
        CGFloat timeLabW = 100;
        
        
        
        UIView *vLine = [[UIView alloc]initWithFrame:CGRectMake(lineX, 0, 1, CELLH)];
        vLine.backgroundColor = UIColorFromRGB(0xe8e7ed);
        [self.contentView addSubview:vLine];
        
        _companyImg = [[UIImageView alloc]initWithFrame:CGRectMake(lineX - 18/2, cellY + 1, 18, 18)];
        _companyImg.image = [UIImage imageNamed:@"Btn_Normal_Fangzi"];
        [self.contentView addSubview:_companyImg];
        
        _companyLab = [[UILabel alloc]initWithFrame:CGRectMake(startX, cellY, kScreenWidth - startX - rightSpace - 70, 20)];
        _companyLab.font = [ViewTool getFont:15.0f];
        _companyLab.textColor = UIColorFromRGB(0x4b4a48);
        [self.contentView addSubview:_companyLab];
        
        _timeLab = [[UILabel alloc]initWithFrame:CGRectMake(kScreenWidth - rightSpace - timeLabW, cellY, timeLabW, 20)];
        _timeLab.textColor = UIColorFromRGB(0xd4d4d6);
        _timeLab.font = [ViewTool getFont:15.0f];
        _timeLab.textAlignment = NSTextAlignmentRight;
        [self.contentView addSubview:_timeLab];
        
        _dateLab = [[UILabel alloc]initWithFrame:CGRectMake(kScreenWidth - rightSpace - timeLabW, _timeLab.maxY, timeLabW, 20)];
        _dateLab.textColor = UIColorFromRGB(0xd4d4d6);
        _dateLab.font = [ViewTool getFont:14.0f];
        _dateLab.textAlignment = NSTextAlignmentRight;
        [self.contentView addSubview:_dateLab];
        
//        CGFloat imageW = 20;
//        UIImageView *imgView = [[UIImageView alloc]initWithFrame:CGRectMake(kScreenWidth - imageW -20, (CELLH - imageW)/2, imageW, imageW)];
//        imgView.image = [UIImage imageNamed:@"Btn_Normal_Xiangyou (1)"];
//        [self.contentView addSubview:imgView];
        
        _crePerLab = [[UILabel alloc]initWithFrame:CGRectMake(startX, _companyLab.maxY + 5, kScreenWidth - startX - rightSpace - timeLabW, 20)];
        _crePerLab.font = [ViewTool getFont:14.0f];
        _crePerLab.textColor = UIColorFromRGB(0xa1a2a7);
        [self.contentView addSubview:_crePerLab];
        
        _addressImg = [[UIImageView alloc]initWithFrame:CGRectMake(lineX - 12/2, _crePerLab.maxY + 5 +2.5, 12, 15)];
        _addressImg.image = [UIImage imageNamed:@"Btn_Normal_Tubiao"];
        [self.contentView addSubview:_addressImg];
        
        _addressLab = [[UILabel alloc]initWithFrame:CGRectMake(startX, _crePerLab.maxY + 5, kScreenWidth - startX - rightSpace - timeLabW, 20)];
        _addressLab.font = [ViewTool getFont:14.0f];
        _addressLab.textColor = UIColorFromRGB(0xa1a2a7);
        [self.contentView addSubview:_addressLab];
        
        
        
        
        //
        UIView *lineView = [[UIView alloc]initWithFrame:CGRectMake(startX, CELLH - 1, kScreenWidth - startX, 1)];
        lineView.backgroundColor = UIColorFromRGB(0xe8e7ed);
        [self.contentView addSubview:lineView];
    }
    return self;
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
